package com.yowasa.xiuxian.engine.hone.special;

import com.yowasa.xiuxian.annoations.SE;
import com.yowasa.xiuxian.engine.hone.SpecialInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.entity.enums.StageEnum;
import com.yowasa.xiuxian.exception.HandlerException;

@SE(name = "碧玉护体")
public class BiYuHuTi implements SpecialInterface {
    @Override
    public String desc() {
        return "修习之后术法抗增加50%";
    }

    @Override
    public ElementEnum getElement() {
        return ElementEnum.SOIL;
    }

    @Override
    public void limit(UserBO user) {
        if (user.getStage() < StageEnum.JIN_DAN.getLevel()) {
            throw new HandlerException("学习/使用碧玉护体必须要如曜之金以上");
        }
    }

    @Override
    public String limitDesc() {
        return "境界达到如曜之金";
    }

    @Override
    public void effectBattle(UserBO userBO,UserBattle userBattle) {
        userBattle.setRes((int) (userBattle.getRes() + userBO.getUserOriginBattle().getRes() * 0.5));
    }
}
